<?php 
global $dir_tpl, $tb_fix, $temp, $anyDB;  
$shopurl = get_data('shop_url','config_values');
$temp->assign("shopurl",$shopurl);
$temp->assign( 'base_tpl', "".$dir_tpl."" );
 /**
  * @author pavennt
  * Hàm tìm link hình ảnh trong nội dung html từ database
  * 
  * 
  */ 
function layhinhtronghtml($noidung){
    preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i',$noidung, $matches);
    $first_img = $matches [1] [0];
    if(empty($first_img)){ //Defines a default image
        $first_img = "img/hinhchuan.jpg";
    }
  return $first_img;

}

$gioithieu =  get_data('shop_about','config_values');
$gioithieuteex =  get_data('shop_term','config_values');
$temp->assign('imagesht',layhinhtronghtml($gioithieu));
$temp->assign('tex_gt',$gioithieuteex);
$temp->display("$dir_tpl/blocks/gioithieu/index.mct"); 
?> 
